//货币系统
#include <iostream>
using namespace std;
const int MAXN=30;
const int MAXM=3000;
int n,m;
int w[MAXN+1];
long long solunum[MAXM+1];

int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++) cin>>w[i];
    solunum[0]=1;
    for(int i=1;i<=n;i++)
        for(int v=w[i];v<=m;v++)
            solunum[v]+=solunum[v-w[i]];
    cout<<solunum[m];
}